﻿using System;
using System.Windows;

namespace iStudio.View.Dialog
{
    /// <summary>
    /// Interaction logic for Alert.xaml
    /// </summary>
    public partial class Alert
    {
        #region Public properties
        public string Details
        {
            get
            {
                return alertCopyDetails.Text;
            }
            set
            {
                if (!String.IsNullOrEmpty(value))
                {
                    alertCopyDetails.Text = value;
                }
            }
        }

        public new string Title
        {
            get
            {
                return alertTitle.Text;
            }
            set
            {
                if (!String.IsNullOrEmpty(value))
                {
                    Title = "iStudio " + value;
                    alertTitle.Text = value;
                } 
            }
        }

        public string Description
        {
            get
            {
                return alertDescription.Text;
            }
            set
            {
                if (!String.IsNullOrEmpty(value))
                {
                    alertDescription.Text = value;
                }
            }
        }

        #endregion

        #region Static overloads

        public static bool? Show (string description)
        {
            Alert alert = new Alert
            {
                Description = description
            };

            return alert.ShowDialog();
        }

        public static bool? Show (string description, string details)
        {
            Alert alert = new Alert
            {
                Description = description,
                Details = details
            };

            return alert.ShowDialog();
        }

        public static bool? Show (string description, string details, string title)
        {
            Alert alert = new Alert
            {
                Description = description,
                Details = details,
                Title = title
            };

            return alert.ShowDialog();
        }

        public static bool? Show (Window owner, string description)
        {
            Alert alert = new Alert
                              {
                                  Owner = owner,
                                  Description = description
                              };

            return alert.ShowDialog ();
        }

        public static bool? Show(Window owner, string description, string details)
        {
            Alert alert = new Alert
            {
                Owner = owner,
                Description = description,
                Details = details
            };

            return alert.ShowDialog();
        }

        public static bool? Show(Window owner, string description, string details, string title)
        {
            Alert alert = new Alert
            {
                Owner = owner,
                Description = description,
                Details = details,
                Title = title
            };

            return alert.ShowDialog();
        }

        #endregion

        #region Private constructor

        private Alert()
        {
            InitializeComponent ();
        }

        #endregion
    }
}
